/*
 * lib2Desa - Another 2D game library in C++
 * Copyright (C) 2009 Erivaldo Xavier de Lima Filho
 *
 * This program is free software and is distributed under GNU General Public License version 3. You can modify and/or redistribute
 * it under the terms of GPL version 3 or posterior version. This program comes with NO WARRANTY, for more details, see LICENSE,
 * or <http://www.gnu.org/licenses>.
 *
 * Contact info:
 *
 *	Erivaldo Xavier de Lima Filho, desadoc@gmail.com
 *
 */

#ifndef _GAME_HPP
#define _GAME_HPP

#include "Core/IRunnable.hpp"
#include "Core/IGameRule.hpp"
#include "Core/Scene.hpp"
#include "Core/IGraphicDevice.hpp"
#include "Core/IEventNotifier.hpp"
#include "Core/ASync.hpp"

#include <list>

#ifndef _NO_NAMESPACE
namespace lib2Desa {
#endif

class Game
{

private:

	shared_ptr<IGraphicDevice> g_dev;

protected:


	shared_ptr<Scene> scene;
	shared_ptr<IGameRule> closeRule;
	shared_ptr<ASync> sync;
	std::list<shared_ptr<IEventNotifier> > notif;

public:

	Game(const shared_ptr<IGraphicDevice>& gd);
	virtual ~Game(void);

	void setCloseRule(const shared_ptr<IGameRule>& r);
	void setScene(const shared_ptr<Scene>& sc);
	void addEventNotifier(const shared_ptr<IEventNotifier>& enf);
	void setSync(const shared_ptr<ASync>& s);

	virtual void run(void);
};

#ifndef _NO_NAMESPACE
}
#endif

#endif /*Game.hpp included*/
